package com.example.retrofit.api;

import com.example.retrofit.domain.User;
import com.example.retrofit.interceptor.TimeStampInterceptor;
import com.github.lianjiatech.retrofit.spring.boot.annotation.Intercept;
import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;

/**
 * @author fans
 * 集成nacos：serviceId = "nacos-user-point", fallback = UserFallbackService.class
 */
@RetrofitClient(baseUrl = "http://localhost:8445")
@Intercept(handler = TimeStampInterceptor.class, include = {"/user/**"}, exclude = "/user/api/healthCheck")
public interface UserApi {

    @GET("/user/api/healthCheck")
    String healthCheck();

    @POST("/user/api/p/req")
    String postReq(@Header("token") String token, @Body User user);
}
